package eleven;

import java.util.ArrayList;

public class ApplesAndOrangesWithOutGenerics {

	public static void main(String[] args) {
		ArrayList<Object> apples = new ArrayList<Object>();
		for (int i = 0; i <3; i++) {
			apples.add(new Apple());
			apples.add(new Orange());
			for (int j = 0; j < apples.size(); j++) {
				((Apple)apples.get(i)).id();
			}
		}
	}

}

class Apple{
	private static long counter;
	private final long id=counter++;
	public long id(){return id;}
}

class Orange{}

